<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>休闲网注册页面</title>

    <link rel="stylesheet" href="css/leisure2.css">
    <script src="js/jquery-1.12.4.js"></script>
    <script>
        $(document).ready(function () {
            $("form").submit(function () {
                var email=$("#email").val();
                if (email==""){
                    $("#email").next().html("邮箱不能为空");
                    return false;
                }else if (email.indexOf("@")==-1){
                    $("#email").next().html("邮箱必须包含@");
                    return false;
                }else if (email.indexOf(".")==-1){
                    $("#email").next().html("邮箱必须包含.");
                    return false;
                }
                $("#email").next().html("");
                var pwd=$("#pwd").val();
                var repwd=$("#repwd").val();
                if (pwd==""){
                    alert("密码不能为空");return false;
                }else if (pwd.length<6){
                    alert("密码长度不能小于6位");return false;
                }else if (pwd!=repwd){
                    alert("两次密码不一致");return false;
                }

                var user=$("#user").val();
                if (user==""){
                    alert("姓名不能位空");return false;
                }
                for (var i=0; i<user.length; i++){
                    var j=user.substring(i,i+1);
                    if (isNaN(j)==false){
                        alert("姓名中不能有数字");return false;
                    }
                }
                return true;
            });
        });
    </script>
</head>
<body>
    <div id="header" class="main">
        <div id="headerLeft">
            <img src="images/logo.gif" />
        </div>
        <div id="headerRight">注册 | 登录 | 帮助</div>
    </div>
    <div class="register">
        <form method="post" name="myform" id="myform">
                <h1 class="bold">注册休闲网</h1>
                <dl>
                    <dt>您的Email：</dt>
                    <dd><input id="email" type="text" class="inputs" /><span></span></dd>
                </dl>
                <dl>
                    <dt>输入密码：</dt>
                    <dd><input id="pwd" type="password" class="inputs" /></dd>
                </dl>
                <dl>
                    <dt>再输入一遍密码：</dt>
                    <dd><input id="repwd" type="password" class="inputs" /></dd>
                </dl>
                <dl>
                    <dt>您的姓名：</dt>
                    <dd><input id="user" type="text" class="inputs" /></dd>
                </dl>
                <dl>
                    <dt>性别：</dt>
                    <dd>
                        <input name="sex" type="radio" value="1" checked="checked" />男
                        <input name="sex" type="radio" value="0" />女</dd>
                </dl>
                <dl>
                    <dt class="left">出生日期：</dt>
                    <dd><select name="year">
                            <option value="1998">1998</option>
                        </select>年
                         <select name="month">
                             <option value="1">1</option>
                         </select>月
                       <select name="day">
                           <option value="12">12</option>
                       </select>日</dd>
                </dl>
                <dl>
                    <dt>&nbsp;</dt>
                    <dd><input name="btn" type="submit" value="注册" class="rb1" /></dd>
                </dl>
        </form>
    </div>
    <div id="footer" class="main"><a href="#">关于我们</a> | <a href="#">诚聘英才</a> |<a href="#"> 联系方式</a>  | <a href="#">帮助中心</a></div>
   <script src="js/jquery-1.12.4.js"></script>

</body>
</html>
